package com.chinasofti.zbestadmin.service.impl;

import com.chinasofti.zbestadmin.dao.model.Admin;
import com.chinasofti.zbestadmin.dao.AdminMapper;
import com.chinasofti.zbestadmin.service.IAdminService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chinasofti.zbestadmin.web.form.AdminForm;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 管理员表 服务实现类
 * </p>
 *
 * @author zbestadmin
 * @since 2019-05-29
 */
@Service
@Slf4j
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements IAdminService {

    @Autowired
    private AdminMapper adminMapper;

    @Override
    public Admin findByAdminNameAndPassword(AdminForm adminForm) {
        Admin admin = adminMapper.findByAdminNameAndPassword(adminForm);

        if (admin!=null ){
            return admin;
        }
        return null;
    }

}
